package com.example.demo.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.demo.mbp.entity.CommonQueryRequest;
import com.example.demo.entity.QuestionBank;
import com.example.demo.service.QuestionBankService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户控制器
 */
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/question")
public class QuestionBankController {

    private  final QuestionBankService questionBankService;

    /**
     * 复杂条件查询用户
     */
    @PostMapping("/query")
    public Page<QuestionBank> queryUsers(@RequestBody CommonQueryRequest request) {
        return questionBankService.queryByCondition(request);
    }
}    